import request from "@/utils/request";
// 合并购物车数据数据
export function mergeCart(arr) {
  return request({
    url: "member/cart/merge",
    method: "post",
    data: arr,
  });
}
// 请求服务器购物车数据
export function getCart() {
  return request({
    url: "member/cart",
    method: "get",
  });
}
// 删除购物车数据
export function delCart(ids, clearAll = false, clearInvalid = false) {
  return request({
    url: "member/cart",
    method: "delete",
    data: { ids, clearAll, clearInvalid },
  });
}
// 添加购物车数据
export function addCart(skuId, count) {
  return request({
    url: "member/cart",
    method: "post",
    data: { skuId, count },
  });
}
